#ifndef ___LIGHT___
#define ___LIGHT___

#include <string.h>
#include <stdlib.h>
#include <stdio.h>


#define print(str) (Uart_Puts(COMM_BT, str))
#define LIGHTSIZE 3 
extern char outbuf[100];
int lightDisplay = 0;

int light[LIGHTSIZE] = {0};

void updateLight()
{
  light[0] = sample_adc12(Adc12Dev_SCAN_CH0);
  if (lightDisplay)
  {
    sprintf(outbuf, "\nLight0:%d", light[0]);
    print(outbuf);
  }
  light[1] = sample_adc12(Adc12Dev_SCAN_CH1);
  if (lightDisplay)
  {
    sprintf(outbuf, "\tLight1:%d", light[1]);
    print(outbuf);
  }
  light[2] = sample_adc12(Adc12Dev_SCAN_CH2);
  if (lightDisplay)
  {
    sprintf(outbuf, "\tLight2:%d\n", light[2]);
    print(outbuf);
  }
}
#endif